<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        // 创建一个电脑对象
        var Computer = {
            color: 'green',
            weight: 1000,
            pingpai: 'lenovo',
            type: 'AMD',
            yongchu: function() {
                console.log('该电脑可以看电影,可以听音乐,可以打游戏和敲代码!');
            }
        }
        for (var k in Computer) {
            console.log(k);
            console.log(Computer[k]);
        }
        Computer.yongchu();

        // 创建一个按钮对象
        var Button = {
            width: 50,
            height: 25,
            bgc: 'pink',
            xingwei: function() {
                console.log('我可以被点击！');
            }
        }
        for (var k in Button) {
            console.log(k);
            console.log(Button[k]);
        }
        Button.xingwei();
    </script>
</body>

</html>